package org.oyrm.kobo.formBuilder.settings;

import java.util.Locale;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;


/**
 * This class holds together all the settings and preferences information
 * for the Form Builder application
 * @author etherton
 *
 */
public class Settings {
	
	private static Locale locale = null;
	
	private static ResourceBundle i18n = null;
	
	/**
	 * Initializes the settings to defaults
	 */
	public static void init()
	{
		Settings.init(new Locale("en", "US", "Windows"));
	}
	
	/**
	 * Initializes the settings to the given locale
	 * @param locale
	 */
	public static void init(Locale locale)
	{
		Settings.locale = locale;
		Settings.i18n =PropertyResourceBundle.getBundle("org.oyrm.kobo.formBuilder.i18n.formbuildertext", locale);
		
		
	}

	/**
	 * Getter for the locale
	 * @return
	 */
	public static Locale getLocale() {
		return locale;
	}

	/**
	 * Getter for the Resource Bundle that has the values of all the strings
	 * @return
	 */
	public static ResourceBundle getI18n() {
		return i18n;
	}
	

}
